Skip to content

Migrate build to Poetry and prep for PyPI release#8

Merged
faizollah merged 3 commits into
mainfrom
poetry-release
Jul 8, 2026
Merged

Migrate build to Poetry and prep for PyPI release#8
faizollah merged 3 commits into
mainfrom
poetry-release

Conversation

@faizollah

Copy link
Copy Markdown
Collaborator

Release-prep for #4 (publish to PyPI). This is the code half; #4 closes once the package is actually live on PyPI.

What changed

  • Build backend hatchling → poetry-core. Kept the PEP 621 [project] layout, so dependency constraints are preserved exactly (no caret upper-caps introduced). Added poetry.lock for reproducible dev/CI.
  • Added [project.urls] — Homepage / Repository / Issues → this repo.
  • Fixed requires-python. >=3.9 was never actually valid: flwr requires >=3.10, and flwr 1.31+ requires >=3.11. Set to >=3.11,<4.0 — matches flwr and our dev environments, and is what lets Poetry resolve a lockfile. Hatchling never checked this; Poetry's resolver surfaced it.
  • Dropped Python 3.10 from the CI matrix to match the new floor.
  • README: install now leads with pip install flwrcrate; states Python ≥ 3.11; source URL points at eScienceLab.

⚠️ Reviewer note (support policy)

This raises the minimum Python from an (invalid) 3.9 to 3.11, dropping 3.10. Rationale: flwr 1.31+ already requires 3.11, so keeping 3.10 would pin those users to flwr ≤ 1.30. Happy to instead keep 3.10 with split flwr constraints if we want to preserve it — flagging since it's a public support change.

Verification

  • poetry build → valid sdist + wheel; wheel contains only flwrcrate/ (no tests), correct metadata (Requires-Python: >=3.11,<4.0, MIT, all URLs).
  • Wheel installs with its full dependency tree into a clean venv and imports (from flwrcrate import FLCrateTracker OK).
  • 51 tests pass at 92% coverage.

Part of #4

Switch the build backend from hatchling to poetry-core, keeping the PEP 621
[project] layout so exact dependency constraints are preserved (no caret
upper-caps introduced). Add poetry.lock for reproducible dev/CI.

- Add [project.urls] (Homepage/Repository/Issues -> eScienceLab/flwrCrate)
- Fix requires-python: ">=3.9" was never valid because flwr requires >=3.10
  (and flwr 1.31+ requires >=3.11). Set ">=3.11,<4.0" to match flwr and the
  supported dev environments; this is what lets Poetry resolve a lockfile.
- Drop Python 3.10 from the CI matrix to match the new floor
- README: lead install with `pip install flwrcrate`, state Python >=3.11,
  and point the source URL at eScienceLab

Verified: poetry build produces a valid sdist+wheel; the wheel installs with
its full dependency tree into a clean venv and imports; 51 tests pass at 92%
coverage.

Part of #4

@elichad elichad left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good - a few minor recommendations

Comment thread .github/workflows/tests.yml Outdated
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the latest Python version is 3.14 - are we able to test and support up to that?

Comment thread pyproject.toml
"flwr>=1.29.0",
"rocrate>=0.13",
"tomli>=2.0; python_version < '3.11'",
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend adding authors and maintainers to this metadata (see https://packaging.python.org/en/latest/specifications/pyproject-toml/#authors-maintainers) - so you get credit for this work! the maintainers get listed automatically on the PyPI page for the package I think

Comment thread pyproject.toml Outdated
dependencies = [
"flwr>=1.29.0",
"rocrate>=0.13",
"tomli>=2.0; python_version < '3.11'",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this tomli line still needed if we do not support versions below 3.11?

faizollah added 2 commits July 7, 2026 13:37
grpcio 1.82.0 (2026-07-06) breaks `flower-superlink` startup; the e2e installs
it unpinned via flwr, so the nightly has been red since then. Pin to the last
known-good grpcio to keep the e2e validating against a working stack. Temporary
workaround tracked in #9.
- CI: extend tests matrix to 3.11-3.14 (verified passing on 3.14); update README
  coverage note to match
- pyproject: add [project] authors + maintainers so credit shows on the PyPI page
- pyproject: drop the direct `tomli; python_version < '3.11'` dependency — redundant
  now the floor is 3.11 (tomli still resolves transitively if anything needs it);
  refresh poetry.lock

Addresses review comments on #8.
@faizollah faizollah merged commit d46cc33 into main Jul 8, 2026
9 checks passed
@faizollah faizollah deleted the poetry-release branch July 8, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants